package com.rxyb.sms.service.factory;

/**
 * 工厂枚举类型
 * <p>
 * 注意顺序，优先使用的在上面
 */
public enum FactoryEnum {

    /**
     * 可友
     */
    $Keyou("Keyou", "keyou"),
    /**
     * 八米
     */
    $Bami("Bami", "bami"),

    ;
    /**
     * key
     */
    private String key;
    /**
     * value
     */
    private String value;


    private FactoryEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static FactoryEnum from(String value) {
        FactoryEnum[] ecs = FactoryEnum.values();
        for (FactoryEnum ec : ecs) {
            if (ec.getValue().equals(value)) {
                return ec;
            }
        }
        return null;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
